const Koa = require('koa');
const Router = require('koa-router');
const koaStatic = require('koa-static');
const app = new Koa();
const router = new Router();

router.get('/api/message',async (ctx)=>{
    ctx.body = JSON.stringify({
        code: 0,
        data: {
            unknow: Math.floor(Math.random()*200+1)
        }
    });
});
app.use(koaStatic(__dirname));
app.use(router.routes());
app.listen(8081, () => {
    console.log('请访问： http://localhost:8081/demo.html');
});
